//
//  ZYCManageCourseSelectDetailCell.m
//  ZDSC
//
//  Created by ZDTX on 2021/7/26.
//

#import "ZYCManageCourseSelectDetailCell.h"
@interface ZYCManageCourseSelectDetailCell ()

@property (nonatomic, strong) UILabel *titleLabel;

@property (nonatomic, strong) UILabel *line;


@end
@implementation ZYCManageCourseSelectDetailCell

- (void)setIsHid:(BOOL)isHid{
    _isHid = isHid;
    _titleLabel.hidden = YES;
}
- (void)setTitleString:(NSString *)titleString{
    _titleString = titleString;
    _titleLabel.text = titleString;
}

- (void)setContentString:(NSString *)contentString{
    _contentString = contentString;
    _contentLabel.text = contentString;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.contentLabel];
        [self.contentView addSubview:self.line];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(14.0f);
            make.centerY.equalTo(self.contentView);
        }];
        
        [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.titleLabel.mas_right).offset(10.0f);
            make.right.equalTo(self.contentView).offset(-14.0f);
            make.top.equalTo(self.contentView).offset(5.0f);
            make.bottom.equalTo(self.contentView).offset(-5.0f);
            // 设置约束的优先级
            make.height.mas_equalTo(44.0f).priorityHigh();
        }];
        

        [self.line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self.contentView);
            make.height.mas_equalTo(1.0f);
        }];
        
    }
    return self;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Light", 16.0f) titleColor:HEX_RGB(@"#999999") textAlignment:ZZTextAlignmentLeft];
    }
    return _titleLabel;
}

- (UILabel *)contentLabel {
    if (!_contentLabel) {
        _contentLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Light", 16.0f) titleColor:HEX_RGB(@"#2B302D") textAlignment:ZZTextAlignmentLeft];
        _contentLabel.numberOfLines = 0;
    }
    return _contentLabel;
}
- (UILabel *)line {
    if (!_line) {
        _line = [[UILabel alloc] init];
        _line.backgroundColor = HEX_RGB(@"#F9F9F9");
    }
    return _line;
}

@end
